<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddTaskRepairOrderTaskWorkOrderIndexInRepairTaskWorkOrderRelationTable extends AbstractMigration
{
    public function up()
    {
        $this->table('repair_task_work_order_relation')
            ->addIndex(['task_work_order_id'], ['type' => 'normal', 'name' => 'idx_task_work_order'])
            ->addIndex(['task_repair_order_id'], ['type' => 'normal', 'name' => 'idx_task_repair_order'])
            ->save();

    }

    public function down()
    {
        $this->table('repair_task_work_order_relation')
            ->removeIndexByName('idx_task_work_order')
            ->removeIndexByName('idx_task_repair_order')
            ->save();
    }
}
